package scala.maven;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

import java.io.File;
import java.util.List;


/**
 * Compiles a directory of Scala source.
 * Corresponds roughly to the compile goal of the maven-compiler-plugin
 *
 * @goal compile
 * @requiresDependencyResolution compile
 * @phase process-sources
 * @description Scala Maven Plugin
 */
public class ScalaCompileMojo extends ScalaMojo {


    /**
     * @parameter expression="${project.build.outputDirectory}"
     */
    protected File outputDir;

    /**
     * @parameter default-value="src/main/scala"
     */
    protected File sourceDir;

    /**
     * @parameter default-value="false"
     */
    protected boolean uncheckedWarnings;

    /**
     * @parameter default-value="false"
     */
    protected boolean deprecationWarnings;

    /**
     * @parameter default-value="false"
     */
    protected boolean useFsc;

    public void execute() throws MojoExecutionException, MojoFailureException {
        super.execute();

        performCompile(outputDir, sourceDir, classpathElements, deprecationWarnings, uncheckedWarnings, useFsc);
    }

}
